#include "util/events/EventGenerator.h"

void EventGenerator::addEventListener(EventListener* eventListener) {
	this->listeners.append(eventListener);
}

void EventGenerator::fireEvent(Event* event) {
	util::LinkedList<EventListener>::Iterator it = this->listeners.iterator();
	while (it.hasNext()) {
		EventListener* current = it.next();
		if (current->getEventType() == event->getType()) {
			current->execute(event);
		}
	}
}
